//- Copyright (c) 2016 Lucky Byte, Inc.
extends ../table

block form_items
  .field.eight.wide
    .ui.labeled.dropdown.selection.input.settl_merid
      span(style="color: #888;") 清算商户： 
      input(type="hidden" name="settl_merid" value="#{settl_merid}")
      i.icon.dropdown
      .default.text 
      .menu
        for merid in settl_merids
          .item(data-value="#{merid.uuid}")
            .right.floated(style="color:#888; font-size:small;") #{merid.merno}
            = merid.name
  .field.nine.wide
    .ui.buttons.right.floated
      button.ui.green.button(type="button"
        onclick="window.location = '/merch'") 返回商户管理

block thead
  tr
    th.center.aligned.collapsing 序号
    th.center.aligned.collapsing 平台商户
    th.center.aligned.collapsing 渠 道
    th.center.aligned 商户编号
    th.center.aligned 商户名称
    th.center.aligned 联系人
    th.center.aligned 联系电话
    th.center.aligned 创建时间
    th.center.aligned 终端数
    th.center.aligned 备 注

block tbody
  each record, index in records
    - var td_class = record.disabled ? 'disabled' : ''
    tr
      td.center.aligned.collapsing
        if page_perms.edit || page_perms.disable
          a(href="/merch/edit/#{record.serial}")= record.serial
      td.center.aligned.collapsing(
        class="#{td_class}")= record.inside ? '是' : '否'
      td.center.aligned.collapsing(
        class="#{td_class}")= constant.merch_chnls[record.chnl] || '未知'
      td.center.aligned.collapsing(class="#{td_class}")= record.merno
      td.center.aligned.collapsing(class="#{td_class}")= record.name
      td.center.aligned.collapsing(class="#{td_class}")= record.contact
      td.center.aligned.collapsing(class="#{td_class}")= record.mobile
      td.center.aligned.collapsing(class="#{td_class}")
        | #{record.ctime.format('YYYY-MM-DD HH:mm:ss')}
      td.center.aligned.collapsing(class="#{td_class}") 0
      td(class="#{td_class}")= record.notes

append code
  script
    :coffee-script
      $ ->
          # 隐藏表单中的关键字查询
          $('.field#keyword').hide()
